package com.test;

import org.junit.Test;

import java.lang.reflect.Array;
import java.util.HashMap;
import java.util.List;

public class test {
    @Test
    public void demo(){
        HashMap map =new HashMap();
        map.put("hello","hello");
        map.put("hello","hello xxx");
        map.put("hello2","hello xxx");
        map.put("hello3","hello xxx");
        map.put("hello4","hello xxx");
        map.put("hello5","hello xxx");
        map.put("hello6","hello xxx");
        map.put("hello7","hello xxx");
        map.put("hello8","hello xxx");
        map.put("hello9","hello xxx");
        map.put("hello10","hello xxx");
        map.put("hello11","hello xxx");
        map.put("hello12","hello xxx");
        map.put("hello13","hello xxx");
        map.put("hello14","hello xxx");
        map.put("hello16","hello xxx");
    }

    public int i []  = new int []{1,2,3,4};;

    @Test
    public void demo2() throws Exception{
        //[I cannot be cast to [Ljava.lang.Object;

        Class<?> cls = test.class.getField("i").getType().getComponentType();//获取数组成员的具体类型
        Object[] os = (Object[]) Array.newInstance(cls, 3);//初始化一个长度为3的 对应类型的数组

        System.out.println(os);
    }



    @Test
    public void demo3() throws Exception{
        List l=null;
        String s= null;
        System.out.println("dsfdsfds"+l);
    }

    @Test
    public void demo4() throws Exception{
        List l=null;
        String s= null;
        System.out.println(String.valueOf(s).getClass());
    }




    @Test
    public void demo5() throws Exception{
        int []  is = new int[] {1,2,3,4,5,5};

        System.out.println(String.valueOf(s).getClass());
    }

}
